---------------------------------------
---------SpaceRace Menu - Main---------
---------------------------------------

if SR_DEBUG then print("SR: cl_menu loaded.") end

--SRMenuVars = {
--
--    PaddingTop = 25,
--    Padding = 5,
--    PanelWidth = 400,
--    PanelHeight = 400,
--    
--    TabWidth = self.PanelWidth - 2 * self.Padding,
--    TabHeight = self.PanelHeight - self.Padding - self.PaddingTop,
--    
--    ScoresWidth = self.TabWidth - 2 * self.Padding,
--    ScoresHeight = self.TabHeight - 2 * self.Padding
--};

SRMenuVars = {
    PaddingTop = 25,
    Padding = 5,
    PanelWidth = 800,
    PanelHeight = 600,
};

SRTabVars = {
    TabWidth = SRMenuVars.PanelWidth - 2 * SRMenuVars.Padding,
    TabHeight = SRMenuVars.PanelHeight - SRMenuVars.Padding - SRMenuVars.PaddingTop,
};

SRScoreVars = { 
    ScoresWidth = SRTabVars.TabWidth - 2 * SRMenuVars.Padding,
    ScoresHeight = SRTabVars.TabHeight - 2 * SRMenuVars.Padding
};
    
--function SRMenu:Show()
function SRMenu()
    if SR_DEBUG then print("SR: cl_menu SR_Menu showing") end

    local Container = vgui.Create( "DFrame" )
    --local Container = vgui.Create( "DPropertySheet" )
        Container:SetPos( (ScrW() - SRMenuVars.PanelWidth) / 2, (ScrH() - SRMenuVars.PanelHeight) / 2 )
        Container:SetSize( SRMenuVars.PanelWidth, SRMenuVars.PanelHeight )
		--Container:SetSize( 800, 600 )
        Container:SetTitle( "SpaceRace Menu" )
        Container:SetVisible( true )
        Container:SetDraggable( false )
        Container:ShowCloseButton( true )
        Container:MakePopup()
    

    
    local Tabs = vgui.Create( "DPropertySheet" )
        Tabs:SetParent( Container )
        Tabs:SetPos( SRMenuVars.Padding, SRMenuVars.PaddingTop )
        Tabs:SetSize( SRTabVars.TabWidth, SRTabVars.TabHeight )
        --Tabs:SetSize( 390, 390 )
        
	SRMenuTabSplash(Tabs)
    SRMenuTabTimes(Tabs)
	SRMenuTabHelp(Tabs)
    --SRMenuTabTimes:Show(Container)
    if LocalPlayer():IsAdmin() then SRMenuTabAdmin(Tabs) end

end

--concommand.Add( "sr_menu", SRMenu:Show() )
concommand.Add( "sr_menu", SRMenu)